<?php
namespace app\admin\controller;

/**
 * @todo 首页操作
 */

class Index extends Common
{
    public function index()
    {
        return $this->fetch();
    }

    public function welcome()
    {
//      halt( session('rules')) ;
//        exit();
        // 获取平台账户详情
        $Umodel = model('User');
        //$todaymap[] = ['us_add_time', 'between', array(input('get.start'), input('get.end'))];
        $data['all'] = $Umodel->count();
        $data['pt'] = $Umodel->where('us_type','in','0,1,2,3')->count();
        $data['one'] = $Umodel->where('us_type',0)->count();
        $data['two'] = $Umodel->where('us_type',1)->count();
        $data['three'] = $Umodel->where('us_type',2)->count();
        $data['four'] = $Umodel->where('us_type',3)->count();
        $data['today'] = $Umodel->whereTime('us_add_time','today')->count();
        $data['month'] = $Umodel->whereTime('us_add_time','month')->count();
//        halt($data);
        $this->assign('data', $data);
        return $this->fetch();
    }
    // ------------------------------------------------------------------------

}
